Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate flaky test detection into test results finisher #342

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Mar 20, 2024

Depends on:
codecov/shared#184

This PR does not make any changes to the database: existing flakes won't be retrieved, new flakes won't be stored, flakes will be recalculated every time we run the test results finisher.

  • Adds the flaky_status column to the Test object in the db
  • Adds existing flaky tests to the PR comment (behind a feature flag)
  • Runs flaky test detection at the end of the test results finisher (behind a feature flag)
  • Updates comment and persists new results from flaky test detection to db

@codecov-staging
Copy link

codecov-staging bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 97.90795% with 5 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
- Coverage   97.52%   97.48%   -0.05%     
==========================================
  Files         394      395       +1     
  Lines       32964    33193     +229     
==========================================
+ Hits        32147    32357     +210     
- Misses        817      836      +19     
Flag Coverage Δ
integration 97.48% <97.90%> (-0.05%) ⬇️
latest-uploader-overall 97.48% <97.90%> (-0.05%) ⬇️
unit 97.48% <97.90%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.84% <94.04%> (+<0.01%) ⬆️
OutsideTasks 97.60% <98.85%> (-0.06%) ⬇️
Files Coverage Δ
rollouts/__init__.py 100.00% <100.00%> (ø)
services/tests/test_flake_detector.py 90.00% <100.00%> (-10.00%) ⬇️
services/tests/test_test_results.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_test_results_finisher.py 100.00% <100.00%> (ø)
services/test_results.py 91.01% <95.65%> (+2.64%) ⬆️
tasks/test_results_finisher.py 94.35% <91.89%> (-1.16%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 97.90795% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 97.48%. Comparing base (8ab2578) to head (4f5d33e).

✅ All tests successful. No failed tests found ☺️

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
- Coverage   97.52%   97.48%   -0.05%     
==========================================
  Files         394      395       +1     
  Lines       32964    33193     +229     
==========================================
+ Hits        32147    32357     +210     
- Misses        817      836      +19     
Flag Coverage Δ
integration 97.48% <97.90%> (-0.05%) ⬇️
latest-uploader-overall 97.48% <97.90%> (-0.05%) ⬇️
unit 97.48% <97.90%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.84% <94.04%> (+<0.01%) ⬆️
OutsideTasks 97.60% <98.85%> (-0.06%) ⬇️
Files Coverage Δ
rollouts/__init__.py 100.00% <100.00%> (ø)
services/tests/test_flake_detector.py 90.00% <100.00%> (-10.00%) ⬇️
services/tests/test_test_results.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_test_results_finisher.py 100.00% <100.00%> (ø)
services/test_results.py 91.01% <95.65%> (+2.64%) ⬆️
tasks/test_results_finisher.py 94.35% <91.89%> (-1.16%) ⬇️

Copy link

codecov-public-qa bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 97.90795% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 97.48%. Comparing base (8ab2578) to head (4f5d33e).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
- Coverage   97.52%   97.48%   -0.05%     
==========================================
  Files         394      395       +1     
  Lines       32964    33193     +229     
==========================================
+ Hits        32147    32357     +210     
- Misses        817      836      +19     
Flag Coverage Δ
integration 97.48% <97.90%> (-0.05%) ⬇️
latest-uploader-overall 97.48% <97.90%> (-0.05%) ⬇️
unit 97.48% <97.90%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.84% <94.04%> (+<0.01%) ⬆️
OutsideTasks 97.60% <98.85%> (-0.06%) ⬇️
Files Coverage Δ
rollouts/__init__.py 100.00% <100.00%> (ø)
services/tests/test_flake_detector.py 90.00% <100.00%> (-10.00%) ⬇️
services/tests/test_test_results.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_test_results_finisher.py 100.00% <100.00%> (ø)
services/test_results.py 91.01% <95.65%> (+2.64%) ⬆️
tasks/test_results_finisher.py 94.35% <91.89%> (-1.16%) ⬇️

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 97.90795% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 97.49%. Comparing base (8ab2578) to head (4f5d33e).

✅ All tests successful. No failed tests found ☺️

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #342      +/-   ##
==========================================
- Coverage   97.53%   97.49%   -0.04%     
==========================================
  Files         425      426       +1     
  Lines       33664    33893     +229     
==========================================
+ Hits        32835    33045     +210     
- Misses        829      848      +19     
Flag Coverage Δ
integration 97.48% <97.90%> (-0.05%) ⬇️
latest-uploader-overall 97.48% <97.90%> (-0.05%) ⬇️
unit 97.48% <97.90%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.84% <94.04%> (+<0.01%) ⬆️
OutsideTasks 97.60% <98.85%> (-0.06%) ⬇️
Files Coverage Δ
rollouts/__init__.py 100.00% <100.00%> (ø)
services/tests/test_flake_detector.py 90.00% <100.00%> (-10.00%) ⬇️
services/tests/test_test_results.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_test_results_finisher.py 100.00% <100.00%> (ø)
services/test_results.py 92.21% <95.65%> (+2.29%) ⬆️
tasks/test_results_finisher.py 95.16% <91.89%> (-1.47%) ⬇️

This change has been scanned for critical changes. Learn more

@joseph-sentry joseph-sentry force-pushed the joseph/integrate-flaky-tests branch 2 times, most recently from bcc5103 to 6f117e3 Compare April 17, 2024 16:12
@joseph-sentry joseph-sentry requested a review from a team April 17, 2024 16:16
Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't spot any copy typos and general logic looks sound

- Add a FLAKY_TEST_DETECTION rollout
- Add dedicated tests for the test results module
- Add flake info to the test results PR comment
- Run flaky test detection after creating the associated objects in the
  db for test results ingestion
@joseph-sentry joseph-sentry merged commit b198235 into main Apr 17, 2024
22 of 30 checks passed
@joseph-sentry joseph-sentry deleted the joseph/integrate-flaky-tests branch April 17, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants